<template>
  <DocumentEditor
      id="docEditor"
      documentServerUrl="https://192.168.1.94:10086/"
      :config="config"
  />
</template>
<script setup>
import { DocumentEditor } from "@onlyoffice/document-editor-vue";
import {reactive} from "vue";

const config = reactive({
  "documentType": "word",
  "document": {
    "title": "【经营】通用合同模板.docx",
    "url": "https://d2nlctn12v279m.cloudfront.net/assets/docs/samples/zh/demo.docx",
    "permissions": {
      "print": false,
      "download": true
    },
    "attachId": "e932e7bb1e4d449aa9a7d8b403b4b517",
    "fileType": "docx",
    "key": "e932e7bb1e4d449aa9a7d8ss517"
  },
  "editorConfig": {
    // 编辑器常规配置
    "customization": {
      // 自动保存可以关闭，常规ctrl+s更好用
      "autosave": true,
      "compactToolbar": true,
      "forcesave": true,
      "toolbarNoTabs": true,
      "help": false,
      "compactHeader": true,
      "hideRightMenu": true,
      "logo": {//logo配置
        "image": "https://www.xinyingzao.cn/skins/imgs/logo.png",
        "imageDark": "https://www.xinyingzao.cn/skins/imgs/logo.png",
        "url": "https://www.xinyingzao.cn/skins/imgs",
        "visible": false
      },
    },
    "mode": "view",//view为只能浏览  edit为编辑
    //这个回调及其的重要
    "callbackUrl": "http://192.168.1.94:8080/onlyoffice/callback",
    // 菜单显示语言
    "lang": "zh-CN",
    // 当前操作用户信息
    "user": {
      "name": "superlu",
      "id": "103"
    },

  }
})
</script>
<style>
html,body,#app{height: 100%;width:100%;margin: 0px}
</style>
